﻿using System.Collections.Generic;

namespace com.binance.client.model.enums
{

	/// <summary>
	/// The event that Asset Change Notification Related ,for example : create order (order.place) ,
	/// commit order (order.match),order refunds（order.refund),order canceled (order.cancel) ,card
	/// deducts transaction fee （order.fee-refund),lever account transfer（margin.transfer),loan
	/// principal（margin.loan),loan interest （margin.interest),return loan interest(margin.repay),other
	/// asset change(other)
	/// </summary>
	public sealed class AccountChangeType
	{


	  public static readonly AccountChangeType NEWORDER = new AccountChangeType("NEWORDER", InnerEnum.NEWORDER, "order.place");

	  public static readonly AccountChangeType TRADE = new AccountChangeType("TRADE", InnerEnum.TRADE, "order.match");

	  public static readonly AccountChangeType REFUND = new AccountChangeType("REFUND", InnerEnum.REFUND, "order.refund");

	  public static readonly AccountChangeType CANCELORDER = new AccountChangeType("CANCELORDER", InnerEnum.CANCELORDER, "order.cancel");

	  public static readonly AccountChangeType FEE = new AccountChangeType("FEE", InnerEnum.FEE, "order.fee-refund");

	  public static readonly AccountChangeType TRANSFER = new AccountChangeType("TRANSFER", InnerEnum.TRANSFER, "margin.transfer");

	  public static readonly AccountChangeType LOAN = new AccountChangeType("LOAN", InnerEnum.LOAN, "margin.loan");

	  public static readonly AccountChangeType INTEREST = new AccountChangeType("INTEREST", InnerEnum.INTEREST, "margin.interest");

	  public static readonly AccountChangeType REPAY = new AccountChangeType("REPAY", InnerEnum.REPAY, "margin.repay");

	  public static readonly AccountChangeType OTHER = new AccountChangeType("OTHER", InnerEnum.OTHER, "other");

	  public static readonly AccountChangeType INVALID = new AccountChangeType("INVALID", InnerEnum.INVALID, "INVALID");

	  private static readonly IList<AccountChangeType> valueList = new List<AccountChangeType>();

	  static AccountChangeType()
	  {
		  valueList.Add(NEWORDER);
		  valueList.Add(TRADE);
		  valueList.Add(REFUND);
		  valueList.Add(CANCELORDER);
		  valueList.Add(FEE);
		  valueList.Add(TRANSFER);
		  valueList.Add(LOAN);
		  valueList.Add(INTEREST);
		  valueList.Add(REPAY);
		  valueList.Add(OTHER);
		  valueList.Add(INVALID);
	  }

	  public enum InnerEnum
	  {
		  NEWORDER,
		  TRADE,
		  REFUND,
		  CANCELORDER,
		  FEE,
		  TRANSFER,
		  LOAN,
		  INTEREST,
		  REPAY,
		  OTHER,
		  INVALID
	  }

	  public readonly InnerEnum innerEnumValue;
	  private readonly string nameValue;
	  private readonly int ordinalValue;
	  private static int nextOrdinal = 0;

	  private readonly string code;

	  internal AccountChangeType(string name, InnerEnum innerEnum, string code)
	  {
		this.code = code;

		  nameValue = name;
		  ordinalValue = nextOrdinal++;
		  innerEnumValue = innerEnum;
	  }

	  public override string ToString()
	  {
		return code;
	  }




		public static IList<AccountChangeType> values()
		{
			return valueList;
		}

		public int ordinal()
		{
			return ordinalValue;
		}

		public static AccountChangeType valueOf(string name)
		{
			foreach (AccountChangeType enumInstance in AccountChangeType.valueList)
			{
				if (enumInstance.nameValue == name)
				{
					return enumInstance;
				}
			}
			throw new System.ArgumentException(name);
		}
	}

}